@using System.Web.Http
@using System.Web.Http.Controllers
@using System.Web.Http.Description
@using System.Collections.ObjectModel
@using WebFoundation.WebServer.Areas.HelpPage.Models
@model Collection<ApiDescription>

@{
    ViewBag.Title = "Web Foundation Web API Help Page";

    // Group APIs by controller
    ILookup<HttpControllerDescriptor, ApiDescription> apiGroups = Model.ToLookup(api => api.ActionDescriptor.ControllerDescriptor);
}

<link type="text/css" href="~/Areas/HelpPage/HelpPage.css" rel="stylesheet" />
<header class="help-page">
    <div class="content-wrapper">
        <div class="float-left">
            <h1>@ViewBag.Title</h1>
        </div>
    </div>
</header>
<div id="body" class="help-page">
    <section class="featured">
        <div class="content-wrapper">
            <h2>Introduction</h2>
            <p>
                The following are the Partial of Web Foundation Web APIs.
            </p>
            <p>
                Total Modules: @apiGroups.Count  , Total APIs:
                @{
                    var count = 0;
                    foreach (var item in apiGroups)
                    {
                        count += apiGroups[item.Key].Count();
                    }

                    @count
                }
            </p>
        </div>
    </section>

    <section class="content-wrapper main-content clear-fix">
        @foreach (var group in apiGroups)
        {
            @Html.DisplayFor(m => group, "ApiGroup")
        }
    </section>
</div>